package cn.actoncode.boot.module.ai.dal.mapper.ability;

import cn.actoncode.boot.framework.mybatis.core.mapper.BaseMapperX;
import cn.actoncode.boot.module.ai.dal.dataobject.ability.AbilityDO;
import cn.actoncode.boot.module.ai.dal.dataobject.ability.AbilityUsedRecordDO;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * 能力 Mapper
 *
 * @author bin
 */
@Mapper
public interface AbilityMapper extends BaseMapperX<AbilityDO> {

    default AbilityDO getAbility(Integer type) {
        return selectOne(new LambdaQueryWrapper<AbilityDO>()
                .eq(AbilityDO::getType, type));
    }

    @Select("SELECT * FROM ai_ability WHERE deleted = FALSE")
    List<AbilityDO> getAbilityList();
}
